public class Test {
    public static void main(String[] args) {
        int a = 24;                         //a=12
        int b = 20;                        //b=18
        int c = a % b;      //4             //c=12
        while(c != 0){
            a = b;          //a=20          //a=18
            b = c;          //b=4           //b=12
            c = a % b;      //c=0           //c=6  证明a与b位置关系并不影响
        }
        System.out.println(b);
    }
}
